%define commit 05b25be64d9503ece2d25de3afc9bc14dfe357eb
%define commit_short %(echo %{commit} | head -c6)

Summary(ru_RU.UTF-8): Идентификация устройства с системой МОС
Summary:	Identification of the device with the MOS
Name:		mos-identify
Version:	3.2
Release:	2.git%{commit_short}.4
License:	GPL
Group:		System/Configuration/Other
Url:		https://hub.mos.ru/mos/src/mos-identify
Vendor:		MOS
Source0:	https://hub.mos.ru/mos/src/mos-identify/-/archive/%{commit}/%{name}-%{commit}.tar.gz

BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Gui)
BuildRequires: pkgconfig(Qt5Widgets)
BuildRequires: pkgconfig(Qt5Network)

Requires: uds-system-agent
Requires: mos-xdg-core
Requires: coreutils

%description
Identification of the device with the Moscow operating system in an educational institution

%description -l ru_RU.UTF-8
Идентификация устройства с операционной системой МОС в образовательном учреждении

%files
%{_bindir}/%{name}
/etc/xdg/mos/autostart/%{name}.desktop
%{_iconsdir}/hicolor/scalable/apps/%{name}.svg

#------------------------------------------------------------------

%prep
%setup -n %{name}-%{commit}

%build
%qmake_qt5 *.pro
%make_build

%install
mkdir -p %{buildroot}%{_bindir}/
mkdir -p %{buildroot}/etc/xdg/mos/autostart
mkdir -p %{buildroot}%{_iconsdir}/hicolor/scalable/apps

install -p -m755 %{name} %{buildroot}%{_bindir}/
desktop-file-install --dir=%{buildroot}/etc/xdg/mos/autostart %{name}.desktop
install -p -m644 img/%{name}.svg %{buildroot}%{_iconsdir}/hicolor/scalable/apps/
